[Storage] Strip sensitive auth info on cross-domain redirect#47541
Merged
weirongw23-msft merged 9 commits intoJun 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a Storage pipeline policy intended to prevent credential/SAS leakage by stripping sensitive authentication headers and query parameters when an HTTP redirect crosses domains, and wires that policy into the Blob, Queue, File Share, and Data Lake pipelines.
Changes:
- Added
StorageSensitiveHeaderCleanupPolicyto scrub sensitive headers and removesigfrom the URL query whenRedirectPolicyflags a cross-domain redirect. - Inserted the new policy into the sync/async pipeline construction for Blob, Queue, File Share, and Data Lake clients.
- Added a Blob unit test covering the redirect-cleanup behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/storage/azure-storage-queue/azure/storage/queue/_shared/policies.py | Adds StorageSensitiveHeaderCleanupPolicy implementation for Queue. |
| sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client.py | Wires the new cleanup policy into the Queue sync pipeline. |
| sdk/storage/azure-storage-queue/azure/storage/queue/_shared/base_client_async.py | Wires the new cleanup policy into the Queue async pipeline. |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/policies.py | Adds StorageSensitiveHeaderCleanupPolicy implementation for File Share. |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client.py | Wires the new cleanup policy into the File Share sync pipeline. |
| sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/base_client_async.py | Wires the new cleanup policy into the File Share async pipeline. |
| sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/policies.py | Adds StorageSensitiveHeaderCleanupPolicy implementation for Data Lake. |
| sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client.py | Wires the new cleanup policy into the Data Lake sync pipeline. |
| sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/base_client_async.py | Wires the new cleanup policy into the Data Lake async pipeline. |
| sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies.py | Adds StorageSensitiveHeaderCleanupPolicy implementation for Blob. |
| sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client.py | Wires the new cleanup policy into the Blob sync pipeline. |
| sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py | Wires the new cleanup policy into the Blob async pipeline. |
| sdk/storage/azure-storage-blob/tests/test_sensitive_redirect.py | Adds unit coverage for redirect-based sensitive header/query cleanup (Blob only). |
jalauzon-msft
approved these changes
Jun 19, 2026
Member
Author
|
/check-enforcer override |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.